package com.colorful.insuranceproject.commonActivity;

import android.os.Bundle;
import android.support.annotation.NonNull;

import com.lovely3x.common.managements.user.UserManager;
import com.lovely3x.versionchecklibrary.VersionCheckLauncherActivity;

import butterknife.ButterKnife;

/**
 * Created by handsome-bob on 2017/5/3.
 * <p>
 * 启动页面
 */
public class Launcher extends VersionCheckLauncherActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSwipeBackLayout().setEnableGesture(false);
    }

    @Override
    public boolean foreVersionCheck() {
        return false;
    }

    @Override
    public String getVersionCheckUrl() {
//        return FlySnailURLConst.getInstance().concatAction(FlySnailURLConst.VERSION_CHECK_URL);
        return "";
    }

    @Override
    public void onEntry(final boolean isFirstEntry) {
        //　可以在该方法中重写进入APP的方式
        if (UserManager.getInstance().isSigned()) {
            launchActivity(MainActivity.class, null, true);
        } else {
            launchActivity(LoginActivity.class, null, true);
        }
        finish();
    }

    @Override
    protected int getContentView() {
        return 0;
    }

    @Override
    protected void initViews() {
        ButterKnife.bind(this);
    }

    @Override
    protected void onViewInitialized() {

    }

    @Override
    public void restoreInstanceOnCreateBefore(@NonNull Bundle savedInstance) {

    }

    @Override
    public void restoreInstanceOnCreateAfter(@NonNull Bundle savedInstance) {

    }
}
